home *** CD-ROM | disk | FTP | other *** search
/ Resource for Source: C/C++ / Resource for Source - C-C++.iso / codelib7 / v_09_09 / 9n09104a < prev    next >
Encoding:
Text File  |  1995-11-01  |  737 b   |  21 lines

  1.  
  2.     long *datapointer;
  3.     int ticks, stopcount;
  4.     ...
  5.      datapointer=(long *) malloc(stopcount*sizeof(long));
  6.      ticks=0;
  7.      while (ticks <=stopcount) 
  8.           {                        /*ERROR: Put last data
  9.                                    item off the end of the 
  10.                                    malloc'd array while 
  11.                                    processing a predefined
  12.                                    amount of incoming data
  13.                                    from a comm channel. */
  14.           if(dataready)
  15.                {                   /* wait for data-ready signal */
  16.                *(datapointer + ticks) = process_data();
  17.                ticks++;
  18.                } 
  19.           }
  20.  
  21.